<%--
  Created by IntelliJ IDEA.
  User: yyf19
  Date: 2019/6/14
  Time: 17:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>首页</title>
    <%@ include file="/WEB-INF/jsp/include/head.jsp" %>
</head>
<body>
<%@ include file="/WEB-INF/jsp/include/nav.jsp" %>
<div class="container">
    <div class="row" style="margin-top: 30px;">
        <div class="col-md-6"></div>
        <div class="col-md-6">
            <form id="inputForm">
                <div class="form-group">
                    <label for="inputUserName">用户名</label>
                    <input type="text" class="form-control" id="inputUserName" name="username" placeholder="用户名">
                </div>
                <div class="form-group">
                    <label for="inputPassword">密码</label>
                    <input type="password" class="form-control" id="inputPassword" name="password" placeholder="密码">
                </div>
                <%--<div class="checkbox">
                    <label>
                        <input type="checkbox"> 记住密码
                    </label>
                </div>--%>
                <button type="button" class="btn btn-default" onclick="doSubmit()">立即登录</button>
            </form>
        </div>
    </div>
</div>
</body>
<%@ include file="/WEB-INF/jsp/include/bodyfoot.jsp" %>
<script>
    function doSubmit() {
        var url = serverApp + "/doLogin";
        var data = getFormData($("#inputForm"))
        $POST_JSON(url, data, function (result) {
            window.location.reload()
        }, function (result) {
            console.log(result)
            alert(result.msg)
        })
        return;
    }
</script>
</html>
